<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript">
$(document).ready(function() {
	$.formValidator.initConfig({
		formid: "myform",
		autotip: true,
		onerror: function(msg, obj) {
			window.top.art.dialog({
				content: msg,
				lock: true,
				width: '200',
				height: '50'
			})
		}
	});
	$("#name").formValidator({
		onshow: "<?php echo L('input').L($column.'_name')?>",
		onfocus: "<?php echo L('input').L($column.'_name')?>"
	}).inputValidator({
		min: 1,
		onerror: "<?php echo L('input').L($column.'_name')?>"
	});

	$("#address").formValidator({
		onshow: "<?php echo L('input').L($column.'_address')?>",
		onfocus: "<?php echo L('input').L($column.'_address')?>"
	}).inputValidator({
		min: 1,
		onerror: "<?php echo L('input').L($column.'_address')?>"
	});

	$("#year").formValidator({
		onshow: "<?php echo L('input').L($column.'_year')?>",
		onfocus: "<?php echo L('input').L($column.'_year')?>"
	}).inputValidator({
		min: 1,
		onerror: "<?php echo L('input').L($column.'_year')?>"
	});


});
</script>
<div class="subnav">
	<div class="content-menu ib-a blue line-x">
	   <a href="./index.php?m=contest&c=manage&a=init&is_activity=<?=$is_activity?>" style="font-size:14px;color: #0000FF;font-weight:bolder;"><em>返回上一级</em></a>	
	</div>
</div>
<div class="pad-10">

	<form name="myform" action="?m=<?php echo ROUTE_M?>&c=<?php echo ROUTE_C?>&a=<?php echo ROUTE_A?>" method="post"
		id="myform" enctype="multipart/form-data">
		<input type="hidden" name="data[parentid]" value="<?=$id?>">
		<input type="hidden" name="data[is_activity]" value="<?=$is_activity?>">
		<div class="content pad-10" id="show_div_1" style="height: auto">
			<fieldset>
				<legend><?php if($is_activity==1){echo '活动';}else{echo '赛事';}?>信息添加</legend>
				<table width="100%" class="table_form">
					<tr>
						<td width="120"><?php echo L($column.'_name')?>：</td>
						<td><input type="text" name="data[name]" id="name"
							class="input-text" value="" /></td>
					</tr>
					<tr>
						<td width="120"><?php echo L($column.'_year')?>：</td>
						<td ><input type="text" id="year" class="input-text"
									name="data[year]"  size="30" /></td>
					</tr>
					<tr>
						<td width="120"><?php echo L($column.'_time')?>：</td>

						<td><?php echo form::date('data[begin_time]', date('Y-m-d'), 0, 0, 'true', 1)?>-<?php echo form::date('data[end_time]', date('Y-m-d'), 0, 0, 'true', 1)?></td>
					</tr>
					<tr>
						<td width="120"><?php echo L($column.'_address')?>：</td>
						<td ><input type="text" id="address" class="input-text"
									name="data[address]"  size="30" /></td>
					</tr>
					<?php if(ROUTE_M == 'information'){?>
					<tr>
						<td width="120">是否是活动：</td>
						<td >
							<input type="hidden" name="id" value="<?=$id?>">
							<input type="hidden" name="source_type" value="<?=$source_type?>">
							<?php echo form::radio($array = array('0'=>'否',''=>'是'), $id = 0, 'name="data[is_activity]"')?>
						</td>
					</tr>
					<?php }?>
					<tr>
						<td width="120"><?php echo L($column.'_type')?>：</td>
						<td>
							<select name="data[type]">
							<option>请选择</option>
								<?php
								foreach ($this->type as $k=>$v) {
									?>
									<option value="<?php echo $k;?>">
										<?php echo $v?>
									</option>
									<?php
								}
								?>
							</select>
						</td>
					</tr>
					<tr>
					<?php if ($is_activity==1){?>
						<td width="120">相关赛事：</td>
						<td>
							<select name="data[relate_id]">
								<option>请选择</option>
								<?=$now_contest?>
							</select>
						</td>
					</tr>
					<?php }?>
					<tr>
						<td width="120"><?php echo L($column.'_slogan')?>：</td>
						<td><textarea rows="10" cols="80" name="data[slogan]"
									  id="slogan"><?php if(isset($data['slogan']) ) { echo $data['slogan'];}?></textarea>
						</td>
					</tr>
					<tr>
						<td width="120"><?php if($is_activity==1){echo '活动宣传图';}else{echo "赛事宣传图";}?>：</td>

						<td><?php echo form::images('data[image_cover]', 'image_cover', '', 'contest', '', 40)?></td>
					</tr>

					<tr>
						<td width="120"><?php echo L($column.'_description')?>：</td>
						<td><textarea rows="10" cols="80" name="data[description]"
								id="description"><?php if(isset($data['description']) ) { echo $data['description'];}?></textarea>
						</td>
					</tr>


					</tr>
				</table>
			</fieldset>


		</div>
		<div class="bk15"></div>
		<?php if(ROUTE_M != 'information'){?>
		<input name="dosubmit" type="submit" id="dosubmit"
			value="<?php echo L('submit')?>" class="button">
		<?php }?>

	</form>

</div>
</body>
</html>